# coding: utf-8

import requests
from requests.cookies import RequestsCookieJar

def get(url, headers=None, cookies=None, stream=None):
    return requests.get(url, headers=headers,  cookies=cookies, stream=stream)

def post(url, data=None, headers=None, cookies=None, stream=None):
    return requests.post(url, data=data, headers=headers, cookies=cookies, stream=stream)

def get_requests_cookie(cookies):
    cookie_dict = RequestsCookieJar()
    if cookies is None:
        return cookie_dict
    for cookie in cookies:
        cookie_dict.set(cookie['name'], cookie['value'])
    return cookie_dict